package com.bbx.taxi.client.Task;

import android.app.Activity;
import com.bbx.api.sdk.model.passanger.NearByDriverBuild;
import com.bbx.api.sdk.model.passanger.Return.MyOrderList.Location;
import com.bbx.api.sdk.net.base.BaseNetwork;
import com.bbx.api.sdk.net.passeger.conn.NearByDriverNet;
import com.bbx.taxi.client.Bean.Message.ObserverListener.DATA_TYPE;
import com.bbx.taxi.client.MyApplication;

/**
 * @Path com.bbx.taxi.client.Task.MyNearByDriverTask.java
 * @Author 严旭文
 * @Date 2016-6-8 下午2:00:28
 * @Company 蓝海（福建）信息技术有限公司
 * @Description 附近的司机
 */
public class MyNearByDriverTask extends BaseTask {
	public DATA_TYPE TYPE = DATA_TYPE.NEARBYDRIVERAR;
	private NearByDriverBuild mNearByDriverBuild;
    private boolean is1or2;
	public MyNearByDriverTask(Activity context, String order_id,
			String line_id, double lng, double lat, double max_distance,
			boolean is1or2) {
		super(context);
		this.is1or2=is1or2;
		mNearByDriverBuild = new NearByDriverBuild(context);
		if (is1or2) {// 获取附近的可接单司机
			mNearByDriverBuild.uid = MyApplication.getInstance().getUid();
			mNearByDriverBuild.access_token = MyApplication.getInstance()
					.getToken();
			mNearByDriverBuild.order_id = order_id;
			mNearByDriverBuild.line_id = line_id;
			Location mLocation = new Location();
			mLocation.lng = lng;
			mLocation.lat = lat;
			mNearByDriverBuild.location = mLocation;
			mNearByDriverBuild.max_distance = max_distance;
		} else {// 获取附近的可接单市内司机2【首页】
			Location mLocation = new Location();
			mLocation.lng = lng;
			mLocation.lat = lat;
			mNearByDriverBuild.location = mLocation;
			mNearByDriverBuild.max_distance = max_distance;
		}

	}

	@Override
	public boolean isShow() {
		return false;
	}

	@Override
	public boolean isReturnString() {
		return false;
	}
	@Override
	public boolean condition() {
		// TODO Auto-generated method stub
		return true;
	}
	@Override
	public void request() {
		setType(TYPE, mNearByDriverBuild);
	}

	@Override
	public void success(int status,Object object) {
		// TODO Auto-generated method stub

	}

	@Override
	public void failed(int status, String msg,String message) {
		// TODO Auto-generated method stub

	}

	@Override
	public BaseNetwork getBaseNetwork() {
		return new NearByDriverNet(context, is1or2);
	}

}
